package cn.bandeqing.product.entity;

import cn.bandeqing.frame.mybatis.config.InsertOrUpdateListener;
import cn.bandeqing.frame.mybatis.entity.BaseEntity;
import cn.bandeqing.product.req.ProductSaveOrUpdateReq;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 产品 实体类。
 *
 * @author fugui
 * @since 2024-01-09
 */
@EqualsAndHashCode(callSuper = true)
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "bdq_product", onInsert = InsertOrUpdateListener.class, onUpdate = InsertOrUpdateListener.class)
@AutoMapper(target = ProductSaveOrUpdateReq.class, convertGenerate = false)
public class Product extends BaseEntity {

    @Id(keyType = KeyType.Auto)
    private Long productId;

    private String productUuid;

    private String productName;

    /**
     * 0=注册 1=上架 2=下架
     */
    private ProductStatus productStatus;

    /**
     * 产品类别ID
     */
    private Long productTypeId;

    private String productTypeName;

    private Boolean productMain;

    // 所有规格中的最低价
    private Double lowPrice;

    private String subTitle;

    private String productMainImg;

    private Integer productSalesVolume;

    private Integer productEvaluateNum;

    private Boolean customerHide;
    private Boolean indexRecommend;
    private Boolean indexHot;

    private Boolean moveHouse;

    private String douyinProductId;

}
